Slightly modified to work without initialization
Slightly modified to work without intialization