Added some functionality
some fixes