initial commit, port from magic ( pre composer )