Added layout.erb, tackled some edge cases