added a bit of pseudocode
changed title to konstantinos version