Fixed code; added methods