Removed some erring code and improved usability