abstracted input code to be replaced by ben's orientation code.