starting from tutorial and working backwards