Copied the procedural code

This is an starting point