now with working output