Fixed all issues. Final version in terms of functionality
Completed functionality