finished.. missing comments and error checking