added rest of preliminary functionality