added various functionality
latest code