begin amf main