worked on final code