this needs to be reworked some