wrote and passed check for errors feature