rewrite table script for better overview