refactored and fixed bug in blue_pink method