implemented better pic handling/management