Final edit

@alloka, please view the code
@madostar, please view documentation