Adding code from personal Lappy