added plenty of useful comments