Lots of changes, new features added and code clean up