Implementation for #7

So, you said "Implement it somehow", now that's the solution.
Open for comments and improvements.