fully functioning and error checking