Added code from offline development