Implement a custom hash table from scratch, explaining how you handle collisions and maintain optimal lookup times.