Throwing code over the wall. Will revise tomorrow.