Added proper responses.

Also cleaned up code for final version.