-adding working code

Assignment completion code.