Added code to handle margins, updated readme and global namespace