Added few checks and fixes for even numbers. Also, added a logic to add
initial values.