Adding features & cleaning code