added major functionality
main code added