merge with zirak's changes