first pass, probably needs more work and formatting