few minor changes, still not working 100%