wrote helper functions for writeACluster2
using login workaround