major restructring, put in prepared statement stuff