fixed errors and changed method names