A alternate solution