adding atonce, margin optional parameters, changing demo to include use case