fixed indentation and added better testing