updated code, set build target to 6.0 to hide deprecation warnings