Initial version

This function is a bit whitespace-tastic