Improved solution a little. Added questions