Array based implentation added. Code Cleanup.