added a command line script for testing. Added comments.