got the basic functionality working