implemented mac learning