moved code to lib/ and bin/