fixed bug and made some things command-line utilites

@ragingSloth