Merging solution for #24

Solution for issue number #24