added notifications and some minor structural changes