Removed various bugs and tried to unify naming convention of files