WIP, complete error checking