try this. this needs to be rewritten completely