First draft of away function. Needs testing