Added tab completeion, seperated out code more.