changed code placement

also added features to "Remove" buttons