Added map lookup logic