very basic functionality acheived
more refactoring bug fixing. more to be done