fixed errors and added new features