fixed problem with opposit keys
ugly merge
final merge result -.-