code is updated

TODO: clean up function code(remove new-lines etc); wait for response
before re-running function